#ifndef __BUTTON_H__
#define __BUTTON_H__

#include "main.h"

#define BUTTON_SCAN_FREQ_HZ             (1000)
#define BUTTON_SCAN_CNT_TO_MS(cnt)      (cnt * 1000 / BUTTON_SCAN_FREQ_HZ)

#define LOGIC_LEVEL                     (0)
#define CLICK_START_TICK                BUTTON_SCAN_CNT_TO_MS(20)
#define SHORT_PRESS_START_TICK          BUTTON_SCAN_CNT_TO_MS(1000)
#define LONG_PRESS_START_TICK           BUTTON_SCAN_CNT_TO_MS(2000)
#define LONG_HOLD_START_TICK            BUTTON_SCAN_CNT_TO_MS(3000)

extern void user_button_init(void);
extern void button_proc(void);

#endif//__BUTTON_H__


